<%@ page language="java" contentType="text/html; charset=UTF-8"
	pageEncoding="UTF-8"%>
<%
	String path = request.getContextPath();
	String basePath = request.getScheme() + "://" + request.getServerName() + ":" + request.getServerPort()
			+ path + "/";
%>
<%@ taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core"%>

<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<html>
<head>
<title>cisau信院免费邮--校园邮箱第一品牌</title>
<link rel="shortcut icon" href="<%=basePath %>images/favicon.ico" type="image/x-icon"/>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
<meta name="description"
	content="app, web app, responsive, admin dashboard, admin, flat, flat ui, ui kit, off screen nav" />
<meta name="viewport"
	content="width=device-width, initial-scale=1, maximum-scale=1" />
<link rel="stylesheet" href="<%=basePath%>js/jPlayer/jplayer.flat.css"
	type="text/css" />
<link rel="stylesheet" href="<%=basePath%>css/bootstrap.css"
	type="text/css" />
<link rel="stylesheet" href="<%=basePath%>css/animate.css"
	type="text/css" />
<link rel="stylesheet" href="<%=basePath%>css/font-awesome.min.css"
	type="text/css" />
<link rel="stylesheet" href="<%=basePath%>css/simple-line-icons.css"
	type="text/css" />
<link rel="stylesheet" href="<%=basePath%>css/font.css" type="text/css" />
<link rel="stylesheet" href="<%=basePath%>css/app.css" type="text/css" />

<style type="text/css">

#bodyL{
float:left;
width:384px;
margin-right:2px;
}
#fd{
position: absolute;
top: 25%;
left: 25%;
border: 8px solid #A1D7FF;
background-color: white;
width:610px;
height:500px;
overflow:hidden;
cursor:move;
}
.content{
background:url(gg.gif) no-repeat; width:610px; height:32px;
}
</style>
<title>Insert title here</title>
</head>
<body class="bg-info dker">
	<section id="content" class="m-t-lg wrapper-md animated fadeInDown">
	<div class="container aside-xl">
		<a class="navbar-brand block" href="index.html"><span
			class="h1 font-bold">欢迎加入</span></a>
		<section class="m-b-lg"> <header class="wrapper text-center">
		<strong>注册一个新的信院邮箱</strong> </header>
		<form action="<%=basePath%>puser/register" method="post"
			onsubmit="return userExist();">
			<div class="form-group">
				<input placeholder="Name" name="realname" id="realname"
					class="form-control rounded input-lg text-center no-border">
			</div>
			<div class="form-group">
				<input type="email" placeholder="Email" name="email" id="email"
					class="form-control rounded input-lg text-center no-border">
			</div>
			<div class="form-group">
				<input type="password" id="password" placeholder="Password"
					name="password"
					class="form-control rounded input-lg text-center no-border">
			</div>
			<div class="form-group">
				<input type="password" id="password2"
					placeholder="Again input Password"
					class="form-control rounded input-lg text-center no-border">
			</div>

			<div class="form-group">
				<input type="text" placeholder="Phone" name="phone"
					class="form-control rounded input-lg text-center no-border">
			</div>
			<div class="checkbox i-checks m-b">
				<label class="m-l"> <input type="checkbox" id="agree" checked=""><i></i>
					同意 <a onclick="show('fd');return false;">用户隐私协议</a>
				</label>
			</div>
			<button type="submit"
				class="btn btn-lg btn-warning lt b-white b-2x btn-block btn-rounded">
				<i class="icon-arrow-right pull-right"></i><span class="m-r-n-lg">Sign
					up</span>
			</button>
			<div class="line line-dashed"></div>
			<p class="text-muted text-center">
				<small>Already have an account?</small>
			</p>
			<a href="<%=basePath %>jsp/login.jsp" class="btn btn-lg btn-info btn-block btn-rounded">Sign
				in</a>
		</form>
		</section>
	</div>
	</section>
	<!-- footer -->
	<footer id="footer">
	<div class="text-center padder clearfix">
		<p>
			<small>网站式框架邮件收发系统 on 农大信院<br>&copy; 2020
			</small>
		</p>
	</div>
	</footer>
	<!-- 弹出框展示start -->
	<div id="fd" style="display:none;filter:alpha(opacity=100);opacity:1;">
	<a href="#" onclick = "closeed('fd');return false;">
<i class="fa fa-chevron-up" style="color:#000;margin-left:5px;margin-top:10px;font-size:30px;"></i>
</a>

<div style="padding:0 15px 15px 15px; font-size:14px; color:#000000">
<h2>隐私政策</h2>
<h5>欢迎使用信院邮箱的软件和服务。</h5>
<p>生效日期：2020年2月1日</p>

<p>我们鼓励用户更新和修改其个人信息以使其有效。用户能在任何时候非常容易地获取并修改其个人信息。用户可以自行决定修改、删除他们的相关资料。</p>

<p>请记住，无论何时您自愿披露个人信息（如在通过电子邮件或在聊天区公布）， 此种信息可能被他人收集及使用，因此造成您的个人信息泄露，我们不承担责任，如果你将个人信息公布在上述渠道，你就有可能造成个人信息泄露。因此，我们提醒并请您慎重考虑是否有必要在上述渠道公开您的个人信息。</p>

<p>最后，您是唯一对您的账号和密码信息负有保密责任的人。任何情况下，请小心妥善保管。</p>




　</div>

</div>
    <!-- 弹出框展示end -->
	
	<script src="<%=basePath%>js/jquery.min.js"></script>
	<!-- Bootstrap -->
	<script src="<%=basePath%>js/bootstrap.js"></script>
	<!-- App -->
	<script src="<%=basePath%>js/app.js"></script>
	<script src="<%=basePath%>js/slimscroll/jquery.slimscroll.min.js"></script>
	<script src="<%=basePath%>js/app.plugin.js"></script>
	<script type="text/javascript"
		src="<%=basePath%>js/jPlayer/jquery.jplayer.min.js"></script>
	<script type="text/javascript"
		src="<%=basePath%>js/jPlayer/add-on/jplayer.playlist.min.js"></script>
	<script type="text/javascript" src="<%=basePath%>js/jPlayer/demo.js"></script>
</body>
<script>

function userExist(){
	debugger;	
	var realname = document.getElementById("realname").value;
	if(realname===""){
		alert("真实姓名不能为空");
		return false;
	}
	var email = document.getElementById("email").value;
	var re = new RegExp("@cisau.com$");
	var flag = re.test(email);
	if(flag===false){
		alert("邮箱应该以\"@cisau.com\"结尾");
		return false;
	}
	var password = document.getElementById("password").value;
	var password2 = document.getElementById("password2").value;
	if(password===""){
		alert("密码不能为空！！");
		return false;
	}
	if(password!=password2){
		alert("两次输入的密码不一致！！");
		return false;
	}
	if(!$('#agree').is(':checked')) {
		alert("同意用户隐私协议之后才可以注册哦！");
		return false;
	}
	var email=document.getElementById("email").value;
	var result = 0; 
	$.ajax( {
		url:'<%=basePath%>puser/userExist',
			async: false,
			type : 'post',
			data : {
				email : email
			},
			datatype : "text",//"xml", "html", "script", "json", "jsonp", "text".           
			success : function(data) {

				if (data!=200) {
					alert("该邮箱已存在！");
					result=1;
					alert(result);
				} 

			},
			error : function() {
				alert("异常！");
			}
		});
	if(result!=1){
		return true;
	}else{
		alert("发生了错误哦");
		return false;
	}
	
	
}
</script>
<script type="text/javascript">
var prox;
var proy;
var proxc;
var proyc;
function show(id){/*--打开--*/
clearInterval(prox);
clearInterval(proy);
clearInterval(proxc);
clearInterval(proyc);
var o = document.getElementById(id);
o.style.display = "block";
o.style.width = "1px";
o.style.height = "1px"; 
prox = setInterval(function(){openx(o,610)},10);
} 
function openx(o,x){/*--打开x--*/
var cx = parseInt(o.style.width);
if(cx < x)
{
   o.style.width = (cx + Math.ceil((x-cx)/5)) +"px";
}
else
{
   clearInterval(prox);
   proy = setInterval(function(){openy(o,300)},10);
}
} 
function openy(o,y){/*--打开y--*/ 
var cy = parseInt(o.style.height);
if(cy < y)
{
   o.style.height = (cy + Math.ceil((y-cy)/5)) +"px";
}
else
{
   clearInterval(proy);   
}
} 
function closeed(id){/*--关闭--*/
clearInterval(prox);
clearInterval(proy);
clearInterval(proxc);
clearInterval(proyc); 
var o = document.getElementById(id);
if(o.style.display == "block")
{
   proyc = setInterval(function(){closey(o)},10);   
} 
} 
function closey(o){/*--打开y--*/ 
var cy = parseInt(o.style.height);
if(cy > 0)
{
   o.style.height = (cy - Math.ceil(cy/5)) +"px";
}
else
{
   clearInterval(proyc);    
   proxc = setInterval(function(){closex(o)},10);
}
} 
function closex(o){/*--打开x--*/
var cx = parseInt(o.style.width);
if(cx > 0)
{
   o.style.width = (cx - Math.ceil(cx/5)) +"px";
}
else
{
   clearInterval(proxc);
   o.style.display = "none";
}
}
 
 
/*-------------------------鼠标拖动---------------------*/ 
var od = document.getElementById("fd"); 
var dx,dy,mx,my,mouseD;
var odrag;
var isIE = document.all ? true : false;
document.onmousedown = function(e){
var e = e ? e : event;
if(e.button == (document.all ? 1 : 0))
{
   mouseD = true;   
}
}
document.onmouseup = function(){
mouseD = false;
odrag = "";
if(isIE)
{
   od.releaseCapture();
   od.filters.alpha.opacity = 100;
}
else
{
   window.releaseEvents(od.MOUSEMOVE);
   od.style.opacity = 1;
} 
}
 
od.onmousedown = function(e){
odrag = this;
var e = e ? e : event;
if(e.button == (document.all ? 1 : 0))
{
   mx = e.clientX;
   my = e.clientY;
   od.style.left = od.offsetLeft + "px";
   od.style.top = od.offsetTop + "px";
   if(isIE)
   {
    od.setCapture();    
    od.filters.alpha.opacity = 50;
   }
   else
   {
    window.captureEvents(Event.MOUSEMOVE);
    od.style.opacity = 0.5;
   }
   
} 
}
document.onmousemove = function(e){
var e = e ? e : event;
 
if(mouseD==true && odrag)
{ 
   var mrx = e.clientX - mx;
   var mry = e.clientY - my; 
   od.style.left = parseInt(od.style.left) +mrx + "px";
   od.style.top = parseInt(od.style.top) + mry + "px";   
   mx = e.clientX;
   my = e.clientY;
   
}
}
 
</script>
</html>